package homework.score.display;

import java.util.List;
import java.util.Map;

public class ListPrinter implements IPrinter {

    @Override
    public String format(List<Map<String, String>> objectsAttrs) {
        StringBuilder builder = new StringBuilder();

        for (Map<String, String> attrs : objectsAttrs) {

            for (String key : attrs.keySet()) {
                builder.append(key);
                builder.append(": ");
                builder.append(attrs.get(key));
                builder.append("\n");
            }
            builder.append("\n------------\n\n");
        }

        return builder.toString();
    }
}
